home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / mus / play / multiplsr.lha / infowin.c < prev    next >
C/C++ Source or Header  |  1992-09-14  |  3KB  |  123 lines

  1. /*
  2.  * MultiPlayer
  3.  * Copyright (C) 1992 Bryan Ford
  4.  *
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2 of the License, or
  8.  * (at your option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  * I (the author of MultiPlayer) can be contacted on the Internet at
  20.  * "bryan.ford@m.cc.utah.edu".  See "Player.doc" for other addresses.
  21.  *
  22.  * $Id: infowin.c,v 4.3 92/07/19 18:08:17 BAF Exp $
  23.  *
  24.  * $Log:    infowin.c,v $
  25.  * Revision 4.3  92/07/19  18:08:17  BAF
  26.  * Adjustment for putting localdata back into RemindNodes
  27.  * 
  28.  * Revision 4.2  92/06/21  11:13:11  BAF
  29.  * Migrated regargs to stdargs
  30.  *
  31.  * Revision 4.1  92/06/06  19:56:29  BAF
  32.  * Major_code_cleanup
  33.  *
  34.  * Revision 3.1  92/05/25  07:53:34  BAF
  35.  * GNU-ized.
  36.  *
  37.  *
  38.  */
  39.  
  40.  
  41. // System includes
  42. #include <exec/types.h>
  43. #include <exec/execbase.h>
  44. #include <intuition/intuition.h>
  45. #include <proto/exec.h>
  46. #include <proto/intuition.h>
  47.  
  48. #include "bry/macros.h"
  49. #include "bry/remind.h"
  50. #include "bry/misc.h"
  51. #include "bry/guido.h"
  52.  
  53. #include "player.h"
  54.  
  55. extern GuidoSpec infowindowspec;
  56. extern short infowinleft, infowintop;
  57.  
  58. extern struct MPWin mpwin;
  59.  
  60. struct Gadget *infowinlvgad;
  61.  
  62. static long check(long sigmask);
  63. void infowinattach(void);
  64. static struct MPWin mpwin = {infowindowspec,&infowinleft,infowinattach,
  65.   {0},{{0},check},{0}};
  66.  
  67. static long
  68. check(long sigmask)
  69. {
  70.   if((sigmask & mpwin.sigmask) && GCheckPanel(mpwin.win,standardcallback,0L))
  71.     setfinmpwin(&mpwin);
  72.   return(0);
  73. }
  74.  
  75. void
  76. infowindetach(void)
  77. {
  78.   if(mpwin.win)
  79.     GDetachListView(mpwin.win,infowinlvgad);
  80. }
  81.  
  82. static long
  83. doattach(void)
  84. {
  85.   if(mpwin.win)
  86.     {
  87.     extern struct MinList *infolist;
  88.     struct MinList *l;
  89.     static struct MinList ml;
  90.  
  91.       if(!(l = infolist))
  92.         NewList(l = &ml);
  93.       GAttachListView(mpwin.win,infowinlvgad,l,0,0);
  94.     }
  95.   return(0);
  96. }
  97.  
  98. void
  99. infowinattach(void)
  100. {
  101.   static remind_decl(node,doattach,0);
  102.  
  103.   if(mpwin.win)
  104.     remind_add(&dolist,&node);
  105. }
  106.  
  107. char *
  108. infowinopenclose(void)
  109. {
  110.   if(mpwin.win)
  111.     {
  112.       setfinmpwin(&mpwin);
  113.       return(0L);
  114.     }
  115.   return(openmpwin(&mpwin));
  116. }
  117.  
  118. void
  119. gui_infowinopenclose(void)
  120. {
  121.   showerr(infowinopenclose());
  122. }
  123.